package com.laboratory.eventlistenerlearning.listener;

import com.laboratory.eventlistenerlearning.event.UserEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

/**
 * 用户事件监听器
 */
@Component
public class UserListener {

    @EventListener
    public void handlerUserEvent(UserEvent userEvent) {
        System.out.println(userEvent.username() + " : " + userEvent.message());
    }

}
